package com.yzt.zhuju.network.service;


import com.yzt.zhuju.network.entity.chatroom.ChatRoomBlacklistEntity;
import com.yzt.zhuju.network.entity.chatroom.ChatRoomDetailInfoEntity;
import com.yzt.zhuju.network.entity.chatroom.ChatRoomInfoEntity;
import com.yzt.zhuju.network.entity.chatroom.ChatRoomUserListEntity;
import com.yzt.zhuju.network.entity.chatroom.LiveRoomSeatEntity;
import com.yzt.zhuju.network.entity.chatroom.MyLiveRoomInfoEntity;

import java.util.List;

import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
import rx.Observable;

/**
 * author : bob
 * date   : 2023/3/22
 * desc   : 聊天室模块接口服务
 */
public interface ChatRoomNewService {

    /**
     * 创建聊天室
     */
    @GET(ChatRoomApiConstant.API_CHAT_ROOM_CREATE)
    Observable<MyLiveRoomInfoEntity> createChatRoom();

    /**
     * 踢下麦克风
     */
    @POST(ChatRoomApiConstant.API_CHAT_ROOM_KICK_MICROPHONE)
    Observable<Object> kickMicrophone(@Body RequestBody body);

    /**
     * 打开、关闭座位
     */
    @POST(ChatRoomApiConstant.API_CHAT_ROOM_SEAT_STATUS_CHANGE)
    Observable<Object> openMicrophonePosition(@Body RequestBody body);

    /**
     * 用户上麦
     */
    @POST(ChatRoomApiConstant.API_CHAT_ROOM_JOIN_MICROPHONE)
    Observable<Object> joinMicrophone(@Body RequestBody body);

    /**
     * 用户下麦
     */
    @POST(ChatRoomApiConstant.API_CHAT_ROOM_LEAVE_MICROPHONE)
    Observable<Object> leaveMicrophone(@Body RequestBody body);

    /**
     * 设置管理员
     */
    @POST(ChatRoomApiConstant.API_CHAT_ROOM_SET_MANAGER)
    Observable<Object> setManager(@Body RequestBody body);

    /**
     * 获取房间座位
     */
    @GET(ChatRoomApiConstant.API_CHAT_ROOM_SEAT)
    Observable<List<LiveRoomSeatEntity>> getRoomSeat(@Query("roomId") String id);

    /**
     * 获取我的房间信息
     */
    @GET(ChatRoomApiConstant.API_CHAT_ROOM_MY_ROOM)
    Observable<MyLiveRoomInfoEntity> getMyRoomInfo();

    /**
     * 进入房间
     */
    @POST(ChatRoomApiConstant.API_CHAT_ROOM_ENTER_ROOM)
    Observable<ChatRoomDetailInfoEntity> enterRoom(@Body RequestBody requestBody);

    /**
     * 离开房间
     */
    @POST(ChatRoomApiConstant.API_CHAT_ROOM_LEAVE_ROOM)
    Observable<Object> leaveRoom(@Body RequestBody body);

    /**
     * 提交编辑页面信息
     */
    @POST(ChatRoomApiConstant.API_CHAT_ROOM_SUBMIT_EDIT_INFO)
    Observable<Object> submitChatRoomEditInfo(@Body RequestBody body);

    /**
     * 聊天室踢人
     */
    @POST(ChatRoomApiConstant.API_CHAT_ROOM_KICK_USER)
    Observable<Object> kickUser(@Body RequestBody body);

    /**
     * 开启/关闭禁言用户
     */
    @POST(ChatRoomApiConstant.API_CHAT_ROOM_BAN_USER)
    Observable<Object> banUser(@Body RequestBody body);

    /**
     * 获取房间内的黑名单
     */
    @GET(ChatRoomApiConstant.API_CHAT_ROOM_BLACKLIST)
    Observable<List<ChatRoomBlacklistEntity>> getChatRoomBlackList(@Query("roomId") String roomId,
                                                                   @Query("page") int page,
                                                                   @Query("size") int size);

    /**
     * 获取房间内的用户列表
     */
    @GET(ChatRoomApiConstant.API_CHAT_ROOM_USER_LIST)
    Observable<List<ChatRoomUserListEntity>> getChatRoomUserList(@Query("roomId") String roomId,
                                                                 @Query("page") int page,
                                                                 @Query("size") int size);

    /**
     * 获取房间内的管理员列表
     */
    @GET(ChatRoomApiConstant.API_CHAT_ROOM_MANAGER_LIST)
    Observable<List<ChatRoomBlacklistEntity>> getChatRoomManagerList(@Query("roomId") String roomId,
                                                                     @Query("page") int page,
                                                                     @Query("size") int size);

    /**
     * 移除聊天室黑名单用户
     */
    @POST(ChatRoomApiConstant.API_CHAT_ROOM_BLACKLIST_REMOVE)
    Observable<Object> blacklistRemove(@Body RequestBody body);

    /**
     * 关注聊天室
     */
    @POST(ChatRoomApiConstant.API_CHAT_ROOM_FOLLOW)
    Observable<Object> chatRoomFollow(@Body RequestBody body);

    /**
     * 修改聊天室背景
     */
    @POST(ChatRoomApiConstant.API_CHAT_ROOM_MODIFY_BG)
    Observable<Object> chatRoomModifyBg(@Body RequestBody body);


    /**
     * 获取聊天室列表
     */
    @GET(ChatRoomApiConstant.API_CHAT_ROOM_LIST)
    Observable<List<ChatRoomInfoEntity>> getChatRoomList(@Query("type") int type,
                                                         @Query("size") int size,
                                                         @Query("page") int page);


}
